package String;

import java.util.Scanner;

public class str {
public static void main(String[] args) {
	System.out.println("input a String");
	Scanner sc=new Scanner(System.in);
	String str=sc.next();
	int i=0;
	int bigcount=0;
	int smallcount=0;
	int numbercount=0;
	int othercount=0;
	for(i=0;i<str.length();i++)
	{
		if(str.charAt(i)>='A'&&str.charAt(i)<='Z')
		{
			bigcount++;
		}
		else if(str.charAt(i)>='a'&&str.charAt(i)<='z')
		{
			smallcount++;
		}
		else if(str.charAt(i)>='0'&&str.charAt(i)<='9')
		{
			numbercount++;
		}
		else
		{
			othercount++;
		}
	}
	System.out.println(bigcount);
	System.out.println(smallcount);
	System.out.println(numbercount);
	System.out.println(othercount);
	
}
}
